const mysql = require("mysql");
var client = mysql.createConnection({
  host: "localhost",
  user: "root",
  password: "",
  database: "web2002ego",
});

function sqlFn(sql, arr, callback) {
  client.query(sql, arr, function(error, result) {
    if (error) {
      console.log(error);
      return;
    }

    callback(result)
  });
}

module.exports = sqlFn;
